<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    var names = ["abc", "cba", "nba"]
    // 查询
    console.log(names[0])
    console.log(names.at(0))
    console.log(names[-1]) // undefined
    console.log(names.at(-1)) // nba

    // 修改
    names[0] = "why"
    console.log(names)

    // 新增
    names[3] = "kobe" // 不建议
    names[10] = "james" // 不建议
    console.log(names)

    // 删除
    delete names[10]
    console.log(names)


  </script>
</body>

</html>